package tagging

import "gitee.com/xuender/oils/ids"

var (
	keyIndex = []byte("index")
	keyNS    = []byte("NS")
	keyTag   = []byte("TA")
)

func NSID(ns string) ids.ID {
	return ids.Hash(append(keyNS, []byte(ns)...))
}

func TagID(tag string) ids.ID {
	return ids.Hash(append(keyTag, []byte(tag)...))
}

func TagsKey(ns, id string) []byte {
	return append(NSID(ns).Bytes(), ids.Hash([]byte(id)).Bytes()...)
}
